package area

import (
	"context"
	"git.mycaigou.com/gfyx/micro-gfyx-api/infrastructure/repository/base/area"
	"git.mycaigou.com/gfyx/micro-gfyx-api/infrastructure/repository/base/profit"
)

type AreaService struct {
	areaRepo   area.AreaRepositoryIface
	profitRepo profit.ProfitRepositoryIface
}

// NewAreaService 构造展示
func NewAreaService(areaRepo area.AreaRepositoryIface, profitRepo profit.ProfitRepositoryIface) AreaServiceIface {
	return &AreaService{
		areaRepo:   areaRepo,
		profitRepo: profitRepo,
	}
}

// AreaTrees 区域树型结构
func (s *AreaService) AreaTrees(ctx context.Context) ([]map[string]interface{}, error) {
	return s.areaRepo.AreaTrees(ctx)
}
